﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace application.forms
{
    public partial class dialogWithOption : common.forms.baseDialogForm
    {
        public dialogWithOption()
        {
            InitializeComponent();
        }
        public void SetOptionList(string[] options)
        {
            optionsCb.Items.Clear();
            optionsCb.Items.AddRange(options);
            if (optionsCb.Items.Count > 0) optionsCb.SelectedIndex = 0;
        }
        public int SelectedOptionIdx
        {
            get { return optionsCb.SelectedIndex;}
            set 
            {
                if (value < 0 || value >= optionsCb.Items.Count) return;
                optionsCb.SelectedIndex=value;
            }
        }
        public void SetOptionText(string str)
        {
            optionsLbl.Text = str;
        }

        protected override bool BeforeAcceptProcess()
        {
            myFormStatus.acceptClose = true;
            return true;
        }
    }
}
